package com.siblings.loan.ui.launch.impl

import com.siblings.loan.config.SibConfigs
import com.siblings.loan.http.ApiService
import com.siblings.loan.http.HttpHelper
import com.siblings.loan.http.IHttpCallback
import org.json.JSONObject
import java.util.TimeZone

/**
 * Siblings
 * @Author wwdeng
 * @CreateTime: 2024/7/4 15:39
 * @Annotation：Model层  接口实现类
 */
class SibLaunchModelImpl{

    /**
     * 获取地区转发
     */
    fun loadSibTimeZoneAction(callBack: IHttpCallback) {
        val params = JSONObject().apply {
            put("p", SibConfigs.SIB_APPNAME)
            put("tz", TimeZone.getDefault().id)
        }
        val httpUrl = ApiService.SIB_BASE_URL + ApiService.API_URL.SIB_API_TIMEZONE_URL
        HttpHelper.postSibAction(httpUrl,params,callBack)
    }

    /**
     * 获取APP配置信息
     */
    fun loadSibCommonConfigAction(callBack: IHttpCallback) {
        val params = JSONObject().apply {
            put("product",SibConfigs.SIB_APPNAME)
            put("path",ApiService.API_PATH.SIB_API_APP_INFO_PATH)
        }
        val httpUrl = ApiService.getHttpUrl(ApiService.API_URL.SIB_API_COMMON_URL)
        HttpHelper.postSibAction(httpUrl,params,callBack)
    }
}